package multithreading.apsOrdenacao;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author fabricio@utfpr.edu.br
 */
public class ExecucaoParalela {

    public static void main(String[] args) {
        System.out.println("Inicio do Main!");

        ExecutorService threadExecutor =
                Executors.newCachedThreadPool();

        final OrdenaVetores ov = new OrdenaVetores(10000);

        threadExecutor.execute(
                new Runnable() {
                    public void run() {
                        ov.Sorteia();
                        ov.Bolha();
                    }
                });

        threadExecutor.execute(
                new Runnable() {

                    public void run() {
                        ov.Sorteia();
                        ov.SelecaoDireta();
                    }
                });

        threadExecutor.execute(
                new Runnable() {

                    public void run() {
                        ov.Sorteia();
                        ov.InsercaoDireta();
                    }
                });

        threadExecutor.shutdown();
        System.out.println("Fim do Main!");
    }
}